from include.fenshu import *
a = fenshu(1,2)
b = fenshu(1,3)
# c = fenshu(1)
# c=a+b
# print(c.toFakeString())
# c = a-b
# print(c.toFakeString())
# c = a*b*b
# print(c.toFakeString())
# c = a/b
# print(c.toFakeString())
# string = "(1/3)+(1/2)"
string = input()
# noneState=-1
left = 0
right = 1
kuohao_state=right
tmp_num = ""
calculator = ""
li=[]
for i,element in enumerate(string):
    if element=='(':
        # print(i)
        kuohao_state=left
        continue
    elif element==')':
        kuohao_state=right
        # li.append(fenshu(tmp_num))
        # tmp_num=""
        continue
    
    if kuohao_state==left:
        tmp_num+=element
        if not string[i+1].isdigit():
            assert string[i+1]==')' or string[i+1]=='/'
            if string[i+1]==')':
                li.append(fenshu(tmp_num))
                # print(tmp_num)
                tmp_num=""
    else :
        if element.isdigit():
            tmp_num+=element
            if i==len(string)-1 or not string[i+1].isdigit():
                li.append(fenshu(tmp_num))
                # print(tmp_num)
                tmp_num=""
        else:
            li.append(element)
for ele in li:
    if isinstance(ele, fenshu):
        print(ele.toFakeString())
    if isinstance(ele, str):
        print(ele)
assert len(li)==3
result = calc(li[0],li[2],li[1])
print(result.toDieString())
